package modeller.databasedesignmodel.query;

import modeller.databasedesignmodel.Attribute;
import modeller.databasedesignmodel.relation.Relation;
import modeller.databasedesignmodel.servicedemand.transaction.sqlquery.demandFetcher.ISQLQueryServiceDemandCalculator;
import modeller.databasedesignmodel.servicedemand.IServiceDemand;
import modeller.databasedesignmodel.transaction.SQLQuery;
import queped.SerializablePair;

import java.util.HashSet;

/**
 * Created by IntelliJ IDEA.
 * User: Jason Ye
 * Date: 05/02/2012
 * Time: 12:16
 */
public class SequentialScanQuery extends SQLQuery {

    public SequentialScanQuery(SerializablePair<Relation, HashSet<Attribute>> relationList) {
        super(relationList);
    }

    @Override
    public String myToString() {

        return "\nSEQUENTIAL SCAN Query which accesses relations in the following order: " + getPrintedAttributeList();

    }

    @Override
    public IServiceDemand acceptCalculation(ISQLQueryServiceDemandCalculator visitor) {
        return visitor.calculate(this);

    }
}
